package com.czxy.enterprise.controller;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.czxy.enterprise.service.EnPhotoService;
import com.czxy.findjob.vo.BaseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 企业图片关联表
 前端控制器
 * </p>
 *
 * @author xuewen
 * @since 2022-02-02
 */
@RestController
@RequestMapping("/enPhoto")
public class EnPhotoController {
    @Autowired
    private EnPhotoService enPhotoService;
    @DeleteMapping("/del/{enterpriseId}/{photoId}")
    private BaseResult delById(@PathVariable("enterpriseId") Integer enterpriseId,@PathVariable("photoId") Integer photoId){
        QueryWrapper queryWrapper = new QueryWrapper();
        queryWrapper.eq("enterprise_id",enterpriseId);
        queryWrapper.eq("photo_id",photoId);
        enPhotoService.remove(queryWrapper);
        return BaseResult.ok("删除成功");

    }
}

